// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Item {
    width: 272
    height: 257

    Image{
        anchors.fill: parent
        fillMode: Image.Center
        source: "images/ui/chat_panel.png"

        Item {
            id: text_mask
            x: 12
            y: 57
            width: 229
            height: 186
            clip: true

            Text {
                id: text
                x: 0
                y: 0
                width: 229
                color: "#ffffff"
                text: ""
                font.family: "Arial"
                wrapMode: Text.WordWrap
                smooth: false
                font.pixelSize: 14

            }

        }

        Slider {
            id: slider
            x: 159
            y: 143
            width: 185
            height: 10
            scale: 1
            rotation: 90
            value: 0
            minimum: 0
            maximum: 100
            onChange: {text.y = 0;  if (text.height > text_mask.height) text.y = -(text.height-text_mask.height)/100*slider.value;}
        }
    }

    function append(p_text){
        text.text+=p_text;
        slider.value = 100;
        text.y = 0;  if (text.height > text_mask.height) text.y = -(text.height-text_mask.height)/100*slider.value;
    }

}
